/**
 * admui-basic v2.1.0 (http://www.admui.com/)
 * Copyright 2015-2019 Admui Team
 * Licensed under the Admui License 1.1 (http://www.admui.com/about/license)
 */
(function($) {
  'use strict';

  window.App.extend({
    run: function() {
      $('.dataTable').DataTable(
        $.concatCpt('dataTable', {
          dom:
            '<"row"<"col-6"<"d-none d-sm-block"B>><"col-6"f>><"row"<"col-12"tr>><"row"<"col-md-12 col-lg-5"i><"col-md-12 col-lg-7"p>>',
          processing: true,
          autoWidth: false, // 禁用自动调整列宽
          rowId: 'userId',
          buttons: {
            dom: {
              container: {
                className: 'btn-group btn-group-sm'
              },
              button: {
                className: 'btn btn-default btn-outline'
              }
            },
            buttons: [
              {
                extend: 'copy',
                text: '拷贝'
              },
              {
                extend: 'excel',
                text: '导出 Excel'
              },
              {
                extend: 'csv',
                text: '导出 CSV'
              },
              {
                extend: 'print',
                text: '打印'
              }
            ]
          }
        })
      );
    }
  });

  window.App.run();
})(jQuery);
